package com.zx.json;

import java.lang.reflect.Field;

import com.zx.framework.plat.user.po.User;

public class Json {

	public static void main(String[] args) {
		
		gen(User.class);
	}
	
	public static void gen(Class<?> t) {
		Field[] fields = t.getDeclaredFields();
		StringBuilder sb = new StringBuilder();
		sb.append("\"");
		for (Field field : fields) {
			
			if(field.getType().isAssignableFrom(Integer.class)){
				sb.append(field.getName()+":int,");
			}
			else if(field.getType().isAssignableFrom(String.class)){
				sb.append(field.getName()+":string,");
			}
		}
		System.out.println(t.getSimpleName()+" " +sb+"\"");
	}

}
